package com.hethongviet.vending.network;

public final class CONSTANTS
{
	public static final class CLIENT_TRANSACTION
	{
		public static final int NONE = 0;
		public static final int SELL = NONE + 1;
		public static final int PRODUCT_PUTIN = SELL + 1;
		public static final int PRODUCT_TAKEOUT = PRODUCT_PUTIN + 1;
		public static final int PRODUCT_CHANGING = PRODUCT_TAKEOUT + 1;
		public static final int BOX_INVENTORY = PRODUCT_CHANGING + 1;
		public static final int UPDATE_DATA = BOX_INVENTORY + 1;
		public static final int PRODUCT = UPDATE_DATA + 1;
		public static final int ACCOUNT = PRODUCT + 1;
		public static final int MACHINE = ACCOUNT + 1;
		public static final int BOX = MACHINE + 1;

	}

	public static final class SERVER_TRANSACTION
	{
		public static final int NONE = 0;
		public static final int REPLY_STATUS = NONE + 1;
		public static final int ACCOUNT = REPLY_STATUS + 1;
		public static final int PRODUCT = ACCOUNT + 1;
		public static final int ERROR = PRODUCT + 1;
		public static final int MACHINE = ERROR + 1;

	}

	public static final class SERVICE
	{
		public static final String SERVER_URL = "http://www.vendingmobi.com/";
		
		public static final String UPDATE_MACHINE_INFO = "UpdateMachineInfo";
		public static final String LOGIN = "CheckAccount";
		public static final String GET_ACCOUNTS = "GetAccounts";
		public static final String GET_PRODUCTS = "GetProducts";
		public static final String GET_BOX_CONFIG = "GetBoxConfig";
		public static final String ADD_PRODUCT_SELLOUT = "AddProductSellOut";
		public static final String ADD_PRODUCT_PUTIN = "AddProductPutIn";
		public static final String ADD_PRODUCT_TAKEOUT = "AddProductTakeOut";
		public static final String ADD_PRODUCT_CHANGE = "ChangeProduct";
		public static final String ADD_BOX_INVENTORY = "AddBoxInventory";
		public static final String UPDATE_BOX = "UpdateBox";
		public static final String UPDATE_ALL = "UpdateAll";
		
		public static final String RESULT_OK = "OK";
		public static final String RESULT_LOGIN_BUYER = "BUYER";
		public static final String RESULT_LOGIN_SALES_MAN = "SALESMAN";
		public static final String RESULT_LOGIN_ADMIN = "ADMIN";
		public static final String RESULT_LOGIN_NOT_EXIST = "ERROR";
		
	}
	
	public static final class JSON
	{

		public static final String NULL = "{}";
		public static final int KEY_TYPE = 0;
		public static final int KEY_VALUE = KEY_TYPE + 1;

		public static final String USERNAME = "Username";
		public static final String PASSWORD = "Password";
		public static final String ACCOUNT_ID = "AccountID";
		public static final String MACHINE_CODE = "MachineCode";
		public static final String TYPE = "Type";
		public static final String ACCOUNT = "Account";
		public static final String PRODUCT = "Product";
		public static final String KEY_DATA_ARRAY = "DataArray";
	}

	public static final class NETWORK_ERROR
	{
		public static final int CONNECT = 5000;
		public static final int HOST = CONNECT + 1;
		public static final int IO = HOST + 1;
	}

	public static final class STATUS
	{
		public static final int CLIENT_SEND_OK = 0;
		public static final int CLIENT_SEND_FAIL_VALUE_NULL = CLIENT_SEND_OK + 1;
		public static final int CLIENT_SEND_FAIL_JSON = CLIENT_SEND_FAIL_VALUE_NULL + 1;
		public static final int CLIENT_SEND_FAIL_JSON_VALUE = CLIENT_SEND_FAIL_JSON + 1;
		public static final int CLIENT_SEND_UNKNOWN_TYPE = CLIENT_SEND_FAIL_JSON_VALUE + 1;
		public static final int CLIENT_WAITING_RESPONSE = CLIENT_SEND_UNKNOWN_TYPE + 1;

		public static final int SERVER_SEND_OK = 0;
		public static final int SERVER_SEND_FAIL_VALUE_NULL = SERVER_SEND_OK + 1;
		public static final int SERVER_SEND_FAIL_JSON = CLIENT_SEND_FAIL_VALUE_NULL + 1;
		public static final int SERVER_SEND_FAIL_JSON_VALUE = CLIENT_SEND_FAIL_JSON + 1;
		public static final int SERVER_SEND_UNKNOWN_TYPE = CLIENT_SEND_FAIL_JSON_VALUE + 1;
		public static final int SERVER_SEND_FAIL_DB = SERVER_SEND_UNKNOWN_TYPE + 1;
		public static final int SERVER_SEND_FAIL_DB_LOAD = SERVER_SEND_FAIL_DB + 1;

		public static final int SERVER_DB_CREATE_FAIL = 1000;
		public static final int SERVER_DB_INSERT_FAIL = SERVER_DB_CREATE_FAIL + 1;
	}

	public static final class PRODUCT_SELL
	{
		public static final String TABLE_NAME = "productsellout";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_BOX_CODE = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_PRODUCT_CODE = COLUMN_INDEX_BOX_CODE + 1;
		public static final int COLUMN_INDEX_ACCOUNT_NUMBER = COLUMN_INDEX_PRODUCT_CODE + 1;
		public static final int COLUMN_INDEX_PRICE = COLUMN_INDEX_ACCOUNT_NUMBER + 1;
		public static final int COLUMN_INDEX_IS_DELIVERIED = COLUMN_INDEX_PRICE + 1;
		public static final int COLUMN_INDEX_DATE = COLUMN_INDEX_IS_DELIVERIED + 1;
		public static final int COLUMN_INDEX_MACHINE_CODE = COLUMN_INDEX_DATE + 1;
		public static final int COLUMN_INDEX_WORK_NUMBER1 = COLUMN_INDEX_DATE + 1;
		public static final int COLUMN_INDEX_WORK_NUMBER2 = COLUMN_INDEX_WORK_NUMBER1 + 1;
		public static final int COLUMN_INDEX_AMOUNT = COLUMN_INDEX_WORK_NUMBER2 + 1;

		public static final String COLUMN_ID = "ID";
		public static final String COLUMN_BOX_CODE = "BoxID";
		public static final String COLUMN_PRODUCT_CODE = "ProductCode";
		public static final String COLUMN_ACCOUNT_NUMBER = "sAccount";
		public static final String COLUMN_PRICE = "iUnitPrice";
		public static final String COLUMN_IS_DELIVERIED = "bDilivery";
		public static final String COLUMN_DATE = "Date";
		public static final String COLUMN_WORK_NUMBER1 = "WorkNumber1";
		public static final String COLUMN_WORK_NUMBER2 = "WorkNumber2";
		public static final String COLUMN_AMOUNT = "ProductQuantity";
		public static final String COLUMN_MACHINE_CODE = "VendingMachineCode";
	}

	public static final class BOX_INVENTORY
	{
		public static final String TABLE_NAME = "productinventorybox";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_BOX_CODE = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_PRODUCT_CODE = COLUMN_INDEX_BOX_CODE + 1;
		public static final int COLUMN_INDEX_AMOUNT = COLUMN_INDEX_PRODUCT_CODE + 1;
		public static final int COLUMN_INDEX_MACHINE_CODE = COLUMN_INDEX_AMOUNT + 1;
		public static final int COLUMN_INDEX_DATE = COLUMN_INDEX_MACHINE_CODE + 1;

		public static final String COLUMN_ID = "ID";
		public static final String COLUMN_BOX_CODE = "BoxID";
		public static final String COLUMN_PRODUCT_CODE = "ProductCode";
		public static final String COLUMN_AMOUNT = "ProductQuantity";
		public static final String COLUMN_MACHINE_CODE = "VendingMachineCode";
		public static final String COLUMN_DATE = "Date";
	}

	public static final class PRODUCT_TAKE_OUT
	{
		public static final String TABLE_NAME = "producttakeout";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_BOX_CODE = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_PRODUCT_CODE = COLUMN_INDEX_BOX_CODE + 1;
		public static final int COLUMN_INDEX_STAFF_SERVICE = COLUMN_INDEX_PRODUCT_CODE + 1;
		public static final int COLUMN_INDEX_STAFF_CHECKER = COLUMN_INDEX_STAFF_SERVICE + 1;
		public static final int COLUMN_INDEX_DATE = COLUMN_INDEX_STAFF_CHECKER + 1;
		public static final int COLUMN_INDEX_AMOUNT = COLUMN_INDEX_DATE + 1;
		public static final int COLUMN_INDEX_MACHINE_CODE = COLUMN_INDEX_AMOUNT + 1;

		public static final String COLUMN_ID = "ID";
		public static final String COLUMN_BOX_CODE = "BoxID";
		public static final String COLUMN_PRODUCT_CODE = "ProductCode";
		public static final String COLUMN_STAFF_SERVICE = "StaffTakeOutProduct";
		public static final String COLUMN_STAFF_CHECKER = "StaffChecker";
		public static final String COLUMN_DATE = "Date";
		public static final String COLUMN_AMOUNT = "ProductQuantity";
		public static final String COLUMN_MACHINE_CODE = "VendingMachineCode";

	}

	public static final class PRODUCT_CHANGE
	{
		public static final String TABLE_NAME = "productchange";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_BOX_CODE = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_PRODUCT_CODE = COLUMN_INDEX_BOX_CODE + 1;
		public static final int COLUMN_INDEX_STAFF_SERVICE = COLUMN_INDEX_PRODUCT_CODE + 1;
		public static final int COLUMN_INDEX_STAFF_CHECKER = COLUMN_INDEX_STAFF_SERVICE + 1;
		public static final int COLUMN_INDEX_DATE = COLUMN_INDEX_STAFF_CHECKER + 1;
		public static final int COLUMN_INDEX_MACHINE_CODE = COLUMN_INDEX_DATE + 1;

		public static final String COLUMN_ID = "ID";
		public static final String COLUMN_BOX_CODE = "BoxID";
		public static final String COLUMN_PRODUCT_CODE = "ProductCode";
		public static final String COLUMN_STAFF_PUT = "StaffPutProduct";
		public static final String COLUMN_STAFF_CHECKER = "StaffChecker";
		public static final String COLUMN_DATE = "Date";
		public static final String COLUMN_MACHINE_CODE = "VendingMachineCode";

	}

	public static final class PRODUCT_PUT_IN
	{
		public static final String TABLE_NAME = "productputin";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_BOX_CODE = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_PRODUCT_CODE = COLUMN_INDEX_BOX_CODE + 1;
		public static final int COLUMN_INDEX_STAFF_SERVICE = COLUMN_INDEX_PRODUCT_CODE + 1;
		public static final int COLUMN_INDEX_STAFF_CHECKER = COLUMN_INDEX_STAFF_SERVICE + 1;
		public static final int COLUMN_INDEX_DATE = COLUMN_INDEX_STAFF_CHECKER + 1;
		public static final int COLUMN_INDEX_AMOUNT = COLUMN_INDEX_DATE + 1;
		public static final int COLUMN_INDEX_MACHINE_CODE = COLUMN_INDEX_AMOUNT + 1;

		public static final String COLUMN_ID = "ID";
		public static final String COLUMN_BOX_CODE = "BoxID";
		public static final String COLUMN_PRODUCT_CODE = "ProductCode";
		public static final String COLUMN_STAFF_SERVICE = "StaffPutProduct";
		public static final String COLUMN_STAFF_CHECKER = "StaffChecker";
		public static final String COLUMN_DATE = "Date";
		public static final String COLUMN_AMOUNT = "ProductQuantity";
		public static final String COLUMN_MACHINE_CODE = "VendingMachineCode";

	}

	public static final class PRODUCT
	{
		public static final String TABLE_NAME = "product";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_NAME = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_CODE = COLUMN_INDEX_NAME + 1;
		public static final int COLUMN_INDEX_PRICE_SELLING = COLUMN_INDEX_CODE + 1;
		public static final int COLUMN_INDEX_PRICE_BUYING = COLUMN_INDEX_PRICE_SELLING + 1;
		public static final int COLUMN_INDEX_GROUP_ID = COLUMN_INDEX_PRICE_BUYING + 1;
		// public static final int COLUMN_INDEX_PRODUCT_SUPPLIER_ID =
		// COLUMN_INDEX_PRODUCT_GROUP_ID + 1;
		public static final int COLUMN_INDEX_IMAGE_PATH = COLUMN_INDEX_GROUP_ID + 1;

		public static final String COLUMN_ID = "ProductID";
		public static final String COLUMN_NAME = "ProductName";
		public static final String COLUMN_CODE = "ProductCode";
		public static final String COLUMN_PRICE_SELLING = "SellingPrice";
		public static final String COLUMN_PRICE_BUYING = "BuyPrice";
		public static final String COLUMN_GROUP_ID = "ProductGroupID";
		// public static final String COLUMN_PRODUCT_SUPPLIER_ID = "SupplierID";
		public static final String COLUMN_IMAGE_PATH = "ProductImages";

	}

	public static final class ACCOUNT
	{
		public static final String TABLE_NAME = "account";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_AMOUNT = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_DATE_CREATED = COLUMN_INDEX_AMOUNT + 1;
		public static final int COLUMN_INDEX_GROUP_ID = COLUMN_INDEX_DATE_CREATED + 1;
		public static final int COLUMN_INDEX_TERMINATED = COLUMN_INDEX_GROUP_ID + 1;
		public static final int COLUMN_INDEX_PIN_CODE = COLUMN_INDEX_TERMINATED + 1;
		public static final int COLUMN_INDEX_ACTIVE = COLUMN_INDEX_PIN_CODE + 1;
		public static final int COLUMN_INDEX_STAFF_ID = COLUMN_INDEX_ACTIVE + 1;
		public static final int COLUMN_INDEX_USER_NAME = COLUMN_INDEX_STAFF_ID + 1;
		public static final int COLUMN_INDEX_PASSWORD = COLUMN_INDEX_USER_NAME + 1;
		public static final int COLUMN_INDEX_POSITION_ID = COLUMN_INDEX_PASSWORD + 1;

		public static final String COLUMN_ID = "AccountID";
		public static final String COLUMN_AMOUNT = "AccountAmount";
		public static final String COLUMN_DATE_CREATED = "DateCreate";
		public static final String COLUMN_GROUP_ID = "AccountGroupID";
		public static final String COLUMN_TERMINATED = "IsTerminated";
		public static final String COLUMN_PIN_CODE = "PinCode";
		public static final String COLUMN_ACTIVE = "Active";
		public static final String COLUMN_STAFF_ID = "StaffID";
		public static final String COLUMN_USER_NAME = "Username";
		public static final String COLUMN_PASSWORD = "Pass";
		public static final String COLUMN_POSITION_ID = "PositionID";

	}

	public static final class BOX
	{
		public static final String TABLE_NAME = "vmbox";

		public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_MACHINE_CODE = COLUMN_INDEX_ID + 1;
		public static final int COLUMN_INDEX_PRODUCT_CODE = COLUMN_INDEX_MACHINE_CODE + 1;
		public static final int COLUMN_INDEX_PRODUCT_PRICE = COLUMN_INDEX_PRODUCT_CODE + 1;
		public static final int COLUMN_INDEX_PRODUCT_AMOUNT = COLUMN_INDEX_PRODUCT_PRICE + 1;

		public static final String COLUMN_ID = "BoxNumber";
		public static final String COLUMN_MACHINE_CODE = "VendingMachineCode";
		public static final String COLUMN_PRODUCT_CODE = "ProductCode";
		public static final String COLUMN_PRODUCT_PRICE = "Price";
		public static final String COLUMN_PRODUCT_AMOUNT = "RemainQuantity";

	}

	public static final class MACHINE
	{
		public static final String TABLE_NAME = "vm";

		// public static final int COLUMN_INDEX_ID = 0;
		public static final int COLUMN_INDEX_CODE = 0;
		public static final int COLUMN_INDEX_DATE_CREATED = COLUMN_INDEX_CODE + 1;
		public static final int COLUMN_INDEX_DATE_TERMINATED = COLUMN_INDEX_DATE_CREATED + 1;
		public static final int COLUMN_INDEX_GROUP = COLUMN_INDEX_DATE_TERMINATED + 1;
		public static final int COLUMN_INDEX_LONGITUDE = COLUMN_INDEX_GROUP + 1;
		public static final int COLUMN_INDEX_LATITTUDE = COLUMN_INDEX_LONGITUDE + 1;
		public static final int COLUMN_INDEX_STATUS = COLUMN_INDEX_LATITTUDE + 1;
		public static final int COLUMN_INDEX_LOCATION_ID = COLUMN_INDEX_STATUS + 1;
		public static final int COLUMN_INDEX_AMOUNT_BOX = COLUMN_INDEX_LOCATION_ID + 1;
		public static final int COLUMN_INDEX_STATUS_RENT = COLUMN_INDEX_AMOUNT_BOX + 1;
		// public static final int COLUMN_INDEX_STAFF_CREATE =
		// COLUMN_INDEX_STATUS_RENT + 1;
		// public static final int COLUMN_INDEX_STAFF_TERMINATE =
		// COLUMN_INDEX_STAFF_CREATE + 1;
		// public static final int COLUMN_INDEX_STAFF_UPDATE =
		// COLUMN_INDEX_STAFF_TERMINATE + 1;

		// public static final String COLUMN_ID = "STT";
		public static final String COLUMN_CODE = "VendingMachineCode";
		public static final String COLUMN_DATE_CREATED = "DateCreate";
		public static final String COLUMN_DATE_TERMINATED = "DateTerminated";
		public static final String COLUMN_GROUP = "VendingMachineGroupID";
		public static final String COLUMN_LONGITUDE = "Longtitude";
		public static final String COLUMN_LATITTUDE = "Lattitude";
		public static final String COLUMN_STATUS = "StatusID";
		public static final String COLUMN_LOCATION_ID = "LocationID";
		public static final String COLUMN_AMOUNT_BOX = "QuantityBox";
		public static final String COLUMN_STATUS_RENT = "StatusRent";
		// public static final String COLUMN_STAFF_CREATE = "StaffCreate";
		// public static final String COLUMN_STAFF_TERMINATE =
		// "StaffTerminated";
		// public static final String COLUMN_STAFF_UPDATE = "StaffUpdate";

	}

}
